<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link type="text/css" rel="stylesheet" href="/public/static/H-ui/static/h-ui/css/H-ui.min.css"/>
    <link type="text/css" rel="stylesheet" href="/public/static/system/system.css">
    <title>登录</title>
</head>
<body>
    <div id="layout" class="container">
        <div id="header" class="col-md-offset-6">
            <h1 class="col-md-offset-2"><div>登录</div></h1>
            <h4 class="col-md-offset-10"><a href="{:url('login/Register/register')}">注册>></a></h4>
            <div id="hint" class="col-md-offset-2">{$hint}</div>
            <form action="{:url('login/Login/dologin')}" method="POST" id="form" class="col-md-offset-2">
                <div>
                    <input type="text" class="input-text input-wm radius size-L" id="Account" name="Account" value="" placeholder="账号.." autocomplete="off"/>
                </div>
                <div>
                    <input type="password" class="input-text input-wm radius size-L" id="Password" name="Password" title="至少要6个字符" value="" placeholder="请输入密码.." autocomplete="off"/>
                </div>
                <div>
                    <input type="text" class="input-text input-wm radius size-L" id ="Captcha" name="Captcha" placeholder="验证码.." autocomplete="off">
                </div>
                <div class="Captcha">
                    <img src="{:url('login/Login/captcha')}" id='captcha'/>
                    <a src="Javascript:;">换一张</a>
                </div>
                    <input type="submit" class="btn btn-default radius size-L input-wm" name="submit" value="登录"/>
            </form>
        </div>
        
    </div>    
<body>
<script>
    //清除提示
    window.onload= function(){
        var hint = document.getElementById("hint");
        var no = document.getElementById("Account");
        var password = document.getElementById("Password");
        var form = document.getElementById("form");

        no.onfocus = function(){
            hint.innerHTML = "";
        }

        password.onfocus = function(){
            hint.innerHTML = "";
        }
    }

    //更换验证码
    var img = document.querySelector("img");
    var a = document.querySelector("a");
    let newCode = "{:url('login/Login/captcha')}?"+(new Date()).getTime();
    function change(){
        img.src = newCode;
        a.src = newCode;
    }
    img.onclick = change;
    a.onclick = change;
</script>
</html>